#pragma once

#include "IndexedGeometry.h"

class Device3D;
/**
* Abstraction for the IndexBuffer concept.
* @author Koen Samyn
*/
class IndexBuffer
{
public:
	/**
	* Creates a new IndexBuffer object.
	* @param type the type of primitive this IndexBuffer object wraps.
	* @param minIndex the minimum index for this IndexBuffer.
	* @param maxIndex the maximum index for this IndexBuffer.
	* @param nrOfPrimitives the number of primitives to draw, in the case of
	* a TriangleList this would be the number of triangles for example.
	*/
	IndexBuffer(PRIMITIVE type, unsigned int minIndex, unsigned int maxIndex, unsigned int nrOfPrimitives);
	/**
	* Deletes the IndexBuffer object.
	*/
	virtual ~IndexBuffer(void);
	/**
	* Sends this IndexBuffer object to the graphics card.
	* Implementations are : DirectXIndexBuffer, OpenGLIndexBuffer.
	*/
	virtual void Draw(Device3D* pDevice)=0;
protected:
	/**
	* The primitive type to render.
	*/
	PRIMITIVE m_Primitive;
	/**
	* The minimum index
	*/
	unsigned int m_Min;
	/**
	* The maximum index.
	*/
	unsigned int m_Max;
	/**
	* The number of primitives to draw.
	*/
	unsigned int m_NumberOfPrimitives;
private:
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	IndexBuffer(const IndexBuffer& t);
	IndexBuffer& operator=(const IndexBuffer& t);
};
